import router from './router'
// import getPageTitle from '@/utils/get-page-title.ts'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style

NProgress.configure({ showSpinner: false }) // NProgress Configuration

router.beforeEach(async (to: any, from: any, next: () => void) => {
  // set page title
//   document.title = getPageTitle(to.meta.title)
  // start progress bar
  NProgress.start()
  next()
})

router.afterEach(() => {
  // finish progress bar
  NProgress.done()
})